package com.itheima.mydemo2.test2;

public abstract class Animal {
    public abstract void eat();
}
class Dog extends Animal{
    @Override
    public void eat() {
        System.out.println("狗吃肉");
    }
    public void watch(){
        System.out.println("看家");
    }
}
class Cat extends  Animal{
    @Override
    public void eat() {
        System.out.println("猫吃鱼");
    }
    public void sleep(){
        System.out.println("睡觉");
    }
}
class Pig extends Animal{
    @Override
    public void eat() {
        System.out.println("猪被吃");
    }
    public void run(){
        System.out.println("猪在跑");
    }

}